#include "bit.h"

#include<stdio.h>

int main()
{
	unsigned char value = 0xFF;
	printf("value == %d\n", value);
	for(int i = 0; i < 8; i++)
	{
		printf("value[%d]==%d\n", i, GetBit(value, i));
	}
	for(int i = 0; i < 8; i++)
		value = SetBit(value, i, 0);
	printf("value == %d\n", value); //this should be zero now.
	for(int i = 0; i < 8; i++)
	{
		printf("value[%d]==%d\n", i, GetBit(value, i));
	}
	printf("checking an out of bounds access now.\n");
	unsigned char value2 = GetBit(value, 100);
	printf("value2==%d\n", value2);
	printf("checking an out of bounds access with set now\n");
	unsigned char value3 = SetBit(value, 100, 1);
	printf("value3==%d\n", value3);
	printf("checking an invalid bit value now\n");
	unsigned char value4 = SetBit(value, 0, 3);
	printf("value4==%d\n", value4);

	printf("checking an invalid bit value with out of bounds access now\n");
	unsigned char value5 = SetBit(value, 10, 0xFF);
	printf("value5 == %d\n", value5);

	printf("Finished all bit test now hurray\n");
	return 0;
}
